<?php
 $url = $_GET["url"];
 //$url1=str_replace('/url2.php/','',$_SERVER["REQUEST_URI"]);//得出需要转换的网址。这里我就偷懒，不做安全检测了，需要的自己加上去
//$downfile=str_replace(" ","%20",$url1);//替换空格之类，可以根据实际情况进行替换
 
 //$url="http://image64.360doc.com/DownloadImg/2013/09/1918/35314035_3.jpg";
 //$url=$downfile;
    $url = str_replace("https://","http://",$url); 
    $dir = pathinfo($url);
    $host = $dir['dirname'];
    $refer = $host.'/';
    $ch = curl_init($url);
    curl_setopt ($ch, CURLOPT_REFERER, $refer);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
    $data = curl_exec($ch);
    curl_close($ch);
    header("Content-type: image/jpeg");
 
 print_r($data);
?>